$('.aui-show').click(function() {
                var pass_type = $('input.password').attr('type');

                if (pass_type === 'password') {
                    $('input.password').attr('type', 'text');
                    $('.aui-show').removeClass('operate-eye-open').addClass('operate-eye-close');
                } else {
                    $('input.password').attr('type', 'password');
                    $('.aui-show').removeClass('operate-eye-close').addClass('operate-eye-open');
                }
            });


var loginUser=null;
$('#login_btu').on('click',function(){
    var mobile=$('#mobile').val();
    var passWord=$("#password").val();

    var param = {
        mobile: mobile,
        passWord:passWord,
        domain:window.document.domain
    };

    $.post("/do_login",param,function(result){
            if(result.code==1){

                //判断是否保存用户名
                var storage = window.localStorage;
                if($("#rem_me").is(':checked')){
                   var mobile =  $("#mobile").val();
                    storage.setItem("mobile",mobile);
                    storage.setItem("rem_me","yes");
                }else{
                    storage.removeItem("mobile");
                    storage.setItem("rem_me","no");
                }
                window.location.href="/index";
            }else {
                $.alert(result.message);
            }
        }
    );
});


$(document).ready(function () {
    //判断是否存在过用户
    var storage = window.localStorage;
    if("yes" == storage.getItem("rem_me")){
        $("#rem_me").attr("checked", true);
        var mobile = storage.getItem("mobile");
        if(mobile!=null && mobile!="" && mobile!=undefined){
            $("#mobile").val(mobile);
        }

    }
});